<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>gamvas.State</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.51 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="gamvas.State"></a>gamvas.<wbr>State</h1><div class=CBody><h4 class=CHeading>Description</h4><p>Game state class, overwrite for own states</p><h4 class=CHeading>Constructor</h4><p>new gamvas.State(name);</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>name</td><td class=CDLDescription>a unique identifier as name</td></tr></table><h4 class=CHeading>Example</h4><p>A hello world state</p><blockquote><pre>myState = gamvas.State.extend({
    draw: function(t) {
        this.c.fillText(&quot;Hello World!&quot;, 10, 10);
    }
});</pre></blockquote><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#gamvas.State" >gamvas.<wbr>State</a></td><td class=SDescription>Game state class, overwrite for own states</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.State.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.disableCamera" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">disableCamera</a></td><td class=SDescription>By default a state provides a full environment for game development. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.State.name" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">name</a></td><td class=SDescription>The name of the state, must be unique within all states</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.autoClear" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">autoClear</a></td><td class=SDescription>If set to true, the screen will automatically cleared before drawing functions are called.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.State.clearColor" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">clearColor</a></td><td class=SDescription>The color to clear the screen, if <a href="#gamvas.State.autoClear" class=LVariable id=link5 onMouseOver="ShowTip(event, 'tt3', 'link5')" onMouseOut="HideTip('tt3')">gamvas.State.autoClear</a> is enabled. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.resource" id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">resource</a></td><td class=SDescription>a <a href="gamvas-resource-js.html#gamvas.Resource" class=LClass id=link7 onMouseOver="ShowTip(event, 'tt6', 'link7')" onMouseOut="HideTip('tt6')">gamvas.Resource</a> instance, to allow easy file loading</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.State.canvas" id=link8 onMouseOver="ShowTip(event, 'tt7', 'link8')" onMouseOut="HideTip('tt7')">canvas</a></td><td class=SDescription>The DOM element of the canvas the game is running on.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.c" id=link9 onMouseOver="ShowTip(event, 'tt8', 'link9')" onMouseOut="HideTip('tt8')">c</a></td><td class=SDescription>a HTML5 2D context of the canvas the game is running on. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#gamvas.State.dimension" id=link10 onMouseOver="ShowTip(event, 'tt9', 'link10')" onMouseOut="HideTip('tt9')">dimension</a></td><td class=SDescription>a object holding the canvas dimension in {w, h}</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.camera" id=link11 onMouseOver="ShowTip(event, 'tt10', 'link11')" onMouseOut="HideTip('tt10')">camera</a></td><td class=SDescription>a <a href="gamvas-camera-js.html#gamvas.Camera" class=LClass id=link12 onMouseOver="ShowTip(event, 'tt11', 'link12')" onMouseOut="HideTip('tt11')">gamvas.Camera</a> instance, to modify camera.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#gamvas.State.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.init" id=link13 onMouseOver="ShowTip(event, 'tt12', 'link13')" onMouseOut="HideTip('tt12')">init</a></td><td class=SDescription>The init function is called only once per state to initialize it.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.enter" id=link14 onMouseOver="ShowTip(event, 'tt13', 'link14')" onMouseOut="HideTip('tt13')">enter</a></td><td class=SDescription>The enter function is called when the state is entered.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.leave" id=link15 onMouseOver="ShowTip(event, 'tt14', 'link15')" onMouseOut="HideTip('tt14')">leave</a></td><td class=SDescription>The enter function is called when the state is left.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.clearScreen" id=link16 onMouseOver="ShowTip(event, 'tt15', 'link16')" onMouseOut="HideTip('tt15')">clearScreen</a></td><td class=SDescription>Clears the screen. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.preDraw" id=link17 onMouseOver="ShowTip(event, 'tt16', 'link17')" onMouseOut="HideTip('tt16')">preDraw</a></td><td class=SDescription>This function is called before camera is applied. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.draw" id=link18 onMouseOver="ShowTip(event, 'tt17', 'link18')" onMouseOut="HideTip('tt17')">draw</a></td><td class=SDescription>Overwrite this function to draw your game objects. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.postDraw" id=link19 onMouseOver="ShowTip(event, 'tt18', 'link19')" onMouseOut="HideTip('tt18')">postDraw</a></td><td class=SDescription>This function is called after camera is applied. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.loading" id=link20 onMouseOver="ShowTip(event, 'tt19', 'link20')" onMouseOut="HideTip('tt19')">loading</a></td><td class=SDescription>Overwrite for a custom loading screen</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.onKeyDown" id=link21 onMouseOver="ShowTip(event, 'tt20', 'link21')" onMouseOut="HideTip('tt20')">onKeyDown</a></td><td class=SDescription>A key on the keyboard was pressed</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.onKeyUp" id=link22 onMouseOver="ShowTip(event, 'tt21', 'link22')" onMouseOut="HideTip('tt21')">onKeyUp</a></td><td class=SDescription>A key on the keyboard was released</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.onMouseDown" id=link23 onMouseOver="ShowTip(event, 'tt22', 'link23')" onMouseOut="HideTip('tt22')">onMouseDown</a></td><td class=SDescription>A mouse button was pressed</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.onMouseUp" id=link24 onMouseOver="ShowTip(event, 'tt23', 'link24')" onMouseOut="HideTip('tt23')">onMouseUp</a></td><td class=SDescription>A mouse button was released</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.onMouseMove" id=link25 onMouseOver="ShowTip(event, 'tt24', 'link25')" onMouseOut="HideTip('tt24')">onMouseMove</a></td><td class=SDescription>The mouse was moved</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.onTouchDown" id=link26 onMouseOver="ShowTip(event, 'tt25', 'link26')" onMouseOut="HideTip('tt25')">onTouchDown</a></td><td class=SDescription>A finger starts touching the display</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.onTouchUp" id=link27 onMouseOver="ShowTip(event, 'tt26', 'link27')" onMouseOut="HideTip('tt26')">onTouchUp</a></td><td class=SDescription>A finger stopped touching the display</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.onTouchMove" id=link28 onMouseOver="ShowTip(event, 'tt27', 'link28')" onMouseOut="HideTip('tt27')">onTouchMove</a></td><td class=SDescription>A finger is sliding over the surface</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.onOrientation" id=link29 onMouseOver="ShowTip(event, 'tt28', 'link29')" onMouseOut="HideTip('tt28')">onOrientation</a></td><td class=SDescription>The device was tilted</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.addActor" id=link30 onMouseOver="ShowTip(event, 'tt29', 'link30')" onMouseOut="HideTip('tt29')">addActor</a></td><td class=SDescription>Add a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link31 onMouseOver="ShowTip(event, 'tt30', 'link31')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> to the state. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.removeActor" id=link32 onMouseOver="ShowTip(event, 'tt31', 'link32')" onMouseOut="HideTip('tt31')">removeActor</a></td><td class=SDescription>Removes a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link33 onMouseOver="ShowTip(event, 'tt30', 'link33')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> from the state.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.registerInputEvents" id=link34 onMouseOver="ShowTip(event, 'tt32', 'link34')" onMouseOut="HideTip('tt32')">registerInputEvents</a></td><td class=SDescription>Send keyboard/mouse events to <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link35 onMouseOver="ShowTip(event, 'tt30', 'link35')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> onKeyDown and similar functions</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.addSound" id=link36 onMouseOver="ShowTip(event, 'tt33', 'link36')" onMouseOut="HideTip('tt33')">addSound</a></td><td class=SDescription>Add a <a href="gamvas-sound-js.html#gamvas.Sound" class=LClass id=link37 onMouseOver="ShowTip(event, 'tt34', 'link37')" onMouseOut="HideTip('tt34')">gamvas.Sound</a> to the state.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#gamvas.State.getActors" id=link38 onMouseOver="ShowTip(event, 'tt35', 'link38')" onMouseOut="HideTip('tt35')">getActors</a></td><td class=SDescription>returns all the actors added with <a href="#gamvas.State.addActor" class=LFunction id=link39 onMouseOver="ShowTip(event, 'tt29', 'link39')" onMouseOut="HideTip('tt29')">gamvas.State.addActor</a> as array, sorted by their <a href="gamvas-actor-js.html#gamvas.Actor.layer" class=LVariable id=link40 onMouseOver="ShowTip(event, 'tt36', 'link40')" onMouseOut="HideTip('tt36')">gamvas.Actor.layer</a></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#gamvas.State.cleanUp" id=link41 onMouseOver="ShowTip(event, 'tt37', 'link41')" onMouseOut="HideTip('tt37')">cleanUp</a></td><td class=SDescription>Internal function that is called on the end of the state processing to remove all actors added to the remove queue via <a href="#gamvas.State.removeActor" class=LFunction id=link42 onMouseOver="ShowTip(event, 'tt31', 'link42')" onMouseOut="HideTip('tt31')">gamvas.State.removeActor</a>.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.disableCamera"></a>disableCamera</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.disableCamera</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>By default a state provides a full environment for game development.&nbsp; This includes a default camera under this.camera.</p><p>If you do not want this behaviour, because you need custom camera code, setting disableCamera to true will disable the default camera.</p><h4 class=CHeading>Default</h4><p>false</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.name"></a>name</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.name</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The name of the state, must be unique within all states</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.autoClear"></a>autoClear</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.autoClear</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>If set to true, the screen will automatically cleared before drawing functions are called.</p><h4 class=CHeading>Default</h4><p>true</p><h4 class=CHeading>See</h4><p><a href="#gamvas.State.clearColor" class=LVariable id=link43 onMouseOver="ShowTip(event, 'tt4', 'link43')" onMouseOut="HideTip('tt4')">gamvas.State.clearColor</a></p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.clearColor"></a>clearColor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.clearColor</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The color to clear the screen, if <a href="#gamvas.State.autoClear" class=LVariable id=link44 onMouseOver="ShowTip(event, 'tt3', 'link44')" onMouseOut="HideTip('tt3')">gamvas.State.autoClear</a> is enabled.&nbsp; It is a string in css color notation.</p><h4 class=CHeading>Default</h4><p>&rsquo;#000000&rsquo;</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.resource"></a>resource</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.resource</td></tr></table></blockquote><p>a <a href="gamvas-resource-js.html#gamvas.Resource" class=LClass id=link45 onMouseOver="ShowTip(event, 'tt6', 'link45')" onMouseOut="HideTip('tt6')">gamvas.Resource</a> instance, to allow easy file loading</p><h4 class=CHeading>Example</h4><blockquote><pre>var image = this.resource.getImage('myImage.png');</pre></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.canvas"></a>canvas</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.canvas</td></tr></table></blockquote><p>The DOM element of the canvas the game is running on.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.c"></a>c</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.c</td></tr></table></blockquote><p>a HTML5 2D context of the canvas the game is running on.&nbsp; Use this to have low level access to the canvas 2D context.</p><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    draw: function(t) {
        this.c.fillText(&quot;Score: &quot;+this.score, 10, 10);
    }
});</pre></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.dimension"></a>dimension</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.dimension</td></tr></table></blockquote><p>a object holding the canvas dimension in {w, h}</p><h4 class=CHeading>Example</h4><blockquote><pre>console.log(&quot;Canvas width/height: &quot;+this.dimension.w+&quot;/&quot;+this.dimension.h);</pre></blockquote></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.camera"></a>camera</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.camera</td></tr></table></blockquote><p>a <a href="gamvas-camera-js.html#gamvas.Camera" class=LClass id=link46 onMouseOver="ShowTip(event, 'tt11', 'link46')" onMouseOut="HideTip('tt11')">gamvas.Camera</a> instance, to modify camera.</p><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    draw: function(t) {
        this.actor.draw(t);
        // rotate 90 degrees per second (in radians 90 degrees is 0.5*PI)
        this.camera.rotate(0.5*Math.PI*t);
    }
});</pre></blockquote></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.init"></a>init</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">init: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The init function is called only once per state to initialize it.</p><p>Overwrite this function to do things like loading images and sounds that are necessary for this state</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.enter"></a>enter</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">enter: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The enter function is called when the state is entered.</p><p>Overwrite this function with code that should run when the state is entered, which can be at the beginning of the game or when the system switches between two states.</p><h4 class=CHeading>See</h4><p><a href="#gamvas.State.leave" class=LFunction id=link47 onMouseOver="ShowTip(event, 'tt14', 'link47')" onMouseOut="HideTip('tt14')">gamvas.State.leave</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.leave"></a>leave</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">leave: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The enter function is called when the state is left.</p><p>Overwrite this function with code that should run when the state is left and a other state will be called after this.</p><h4 class=CHeading>See</h4><p><a href="#gamvas.State.enter" class=LFunction id=link48 onMouseOver="ShowTip(event, 'tt13', 'link48')" onMouseOut="HideTip('tt13')">gamvas.State.enter</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.clearScreen"></a>clearScreen</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">clearScreen: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Clears the screen.&nbsp; This is usually called automatically unless you deactivate automatic screen clearing with <a href="#gamvas.State.autoClear" class=LVariable id=link49 onMouseOver="ShowTip(event, 'tt3', 'link49')" onMouseOut="HideTip('tt3')">gamvas.State.autoClear</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.preDraw"></a>preDraw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>preDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>This function is called before camera is applied.&nbsp; Overwrite it to draw things after screen clear and before zoom/rotation/move of camera is applied.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time elapsed since the last frame</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.draw"></a>draw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>draw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Overwrite this function to draw your game objects.&nbsp; All objects drawn in the draw function are drawn under camera influence, means the are drawn moved, scaled and rotated on the screen, depending on how the settings of this.camera are.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time elapsed since the last frame</td></tr></table><h4 class=CHeading>Example</h4><p>Draw a actor moving 20 pixels per second along the x axis</p><blockquote><pre>myState = gamvas.State.extend({
    draw: function(t) {
        this.myActor.draw(t);
        this.myActor.move(20*t, 0);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.postDraw"></a>postDraw</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>postDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>This function is called after camera is applied.&nbsp; Overwrite it to draw things that are not under camera influence, like score or HUD elements.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time elapsed since the last frame</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    postDraw: function(t) {
        this.c.fillText(&quot;Score: &quot;+this.score, 10, 470);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.loading"></a>loading</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>loading: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Overwrite for a custom loading screen</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>t</td><td class=CDLDescription>the time elapsed since the last frame</td></tr></table><h4 class=CHeading>See</h4><p><a href="gamvas-resource-js.html#gamvas.Resource.status" class=LFunction id=link50 onMouseOver="ShowTip(event, 'tt38', 'link50')" onMouseOut="HideTip('tt38')">gamvas.Resource.status</a></p><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
   loading: function(t) {
      this.c.fillText(&quot;Loading: &quot;+(100*this.resource.status())+&quot;%&quot;, 10, 10);
   }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onKeyDown"></a>onKeyDown</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyDown: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A key on the keyboard was pressed</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>keyCode</td><td class=CDLDescription>The keycode of the key (e.g. gamvas.key.RETURN)</td></tr><tr><td class=CDLEntry>character</td><td class=CDLDescription>The actual character (e.g.&nbsp; &lsquo;a&rsquo;)</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>Returns</h4><p>true or false, depending if it handled the event or not</p><h4 class=CHeading>See</h4><p><a href="gamvas-key-js.html#gamvas.key.exitEvent" class=LFunction id=link51 onMouseOver="ShowTip(event, 'tt39', 'link51')" onMouseOut="HideTip('tt39')">gamvas.key.exitEvent</a> <a href="#gamvas.State.onKeyUp" class=LFunction id=link52 onMouseOver="ShowTip(event, 'tt21', 'link52')" onMouseOut="HideTip('tt21')">gamvas.State.onKeyUp</a></p><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    onKeyDown: function(keyCode) {
        if (keyCode == gamvas.key.SPACE) {
            this.firePlayerGun();
        }
        return gamvas.key.exitEvent();
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onKeyUp"></a>onKeyUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyUp: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A key on the keyboard was released</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>keyCode</td><td class=CDLDescription>The keycode of the key (e.g. gamvas.key.RETURN)</td></tr><tr><td class=CDLEntry>character</td><td class=CDLDescription>The actual character (e.g.&nbsp; &lsquo;a&rsquo;)</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>Returns</h4><p>true or false, depending if it handled the event or not</p><h4 class=CHeading>See</h4><p><a href="gamvas-key-js.html#gamvas.key.exitEvent" class=LFunction id=link53 onMouseOver="ShowTip(event, 'tt39', 'link53')" onMouseOut="HideTip('tt39')">gamvas.key.exitEvent</a> <a href="#gamvas.State.onKeyDown" class=LFunction id=link54 onMouseOver="ShowTip(event, 'tt20', 'link54')" onMouseOut="HideTip('tt20')">gamvas.State.onKeyDown</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onMouseDown"></a>onMouseDown</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseDown: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A mouse button was pressed</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>button</td><td class=CDLDescription>The mouse button that was pressed (e.g. gamvas.mouse.LEFT)</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position on the screen the mousepointer was while pressed</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>Returns</h4><p>true or false, depending if it handled the event or not</p><h4 class=CHeading>See</h4><p><a href="gamvas-mouse-js.html#gamvas.mouse.exitEvent" class=LFunction id=link55 onMouseOver="ShowTip(event, 'tt40', 'link55')" onMouseOut="HideTip('tt40')">gamvas.mouse.exitEvent</a> <a href="gamvas-mouse-js.html#gamvas.mouse" class=LClass id=link56 onMouseOver="ShowTip(event, 'tt41', 'link56')" onMouseOut="HideTip('tt41')">gamvas.mouse</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onMouseUp"></a>onMouseUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseUp: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>A mouse button was released</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>button</td><td class=CDLDescription>The mouse button that was released (e.g. gamvas.mouse.LEFT)</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position on the screen the mousepointer was while released</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>Returns</h4><p>true or false, depending if it handled the event or not</p><h4 class=CHeading>See</h4><p><a href="gamvas-mouse-js.html#gamvas.mouse.exitEvent" class=LFunction id=link57 onMouseOver="ShowTip(event, 'tt40', 'link57')" onMouseOut="HideTip('tt40')">gamvas.mouse.exitEvent</a> <a href="gamvas-mouse-js.html#gamvas.mouse" class=LClass id=link58 onMouseOver="ShowTip(event, 'tt41', 'link58')" onMouseOut="HideTip('tt41')">gamvas.mouse</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onMouseMove"></a>onMouseMove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseMove: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>The mouse was moved</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The position where the mousecursor was</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table><h4 class=CHeading>Returns</h4><p>true or false, depending if it handled the event or not</p><h4 class=CHeading>See</h4><p><a href="gamvas-mouse-js.html#gamvas.mouse.exitEvent" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt40', 'link59')" onMouseOut="HideTip('tt40')">gamvas.mouse.exitEvent</a></p><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    onMouseMove: function(x, y) {
        this.mousePointerImage.setPosition(x, y);
        return gamvas.mouse.exitEvent();
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onTouchDown"></a>onTouchDown</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchDown: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A finger starts touching the display</p><h4 class=CHeading>Description</h4><p>The id is a integer representing the finger used.&nbsp; Starts with 0 next finger would be 1, if the first finger would be removed from the display and another finger will be added, the new finger would become id 0 again, as id 0 was not used anymore, when the new finger was added</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>A unique integer to identify certain fingers</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The screen position, where the finger was put down</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onTouchUp"></a>onTouchUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchUp: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A finger stopped touching the display</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>A unique integer to identify certain fingers</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The screen position, where the finger was put down</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onTouchMove"></a>onTouchMove</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchMove: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>A finger is sliding over the surface</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>id</td><td class=CDLDescription>A unique integer to identify certain fingers</td></tr><tr><td class=CDLEntry>x/y</td><td class=CDLDescription>The screen position, where the finger was put down</td></tr><tr><td class=CDLEntry>ev</td><td class=CDLDescription>The JavaScript event object</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.onOrientation"></a>onOrientation</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onOrientation: function(</td><td class="PParameter  prettyprint " nowrap>alpha,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>beta,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>gamma</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>The device was tilted</p><h4 class=CHeading>Description</h4><h4 class=CHeading>If you lay the device flat to the ground, the default values are</h4><p>alpha 180, beta 0, gamma 0.&nbsp; The values are measured in degrees.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>alpha</td><td class=CDLDescription>The rotation as if you would hold your device as a steering wheel in front of you</td></tr><tr><td class=CDLEntry>beta</td><td class=CDLDescription>The rotation if you tilt the device away from you/towards you</td></tr><tr><td class=CDLEntry>gamma</td><td class=CDLDescription>The rotation if you tilt the device to the side</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.addActor"></a>addActor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addActor: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Add a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link60 onMouseOver="ShowTip(event, 'tt30', 'link60')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> to the state.&nbsp; Actors added to a state are drawn automatically.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>act</td><td class=CDLDescription>a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link61 onMouseOver="ShowTip(event, 'tt30', 'link61')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> object</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    init: function() {
        this.myActor = new gamvas.Actor('myactor', 10, 20);
        this.addActor(this.myActor);
    },
    draw: function(t) {
        // i dont need to draw this.myActor, it draws automatically
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.removeActor"></a>removeActor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>removeActor: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Removes a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link62 onMouseOver="ShowTip(event, 'tt30', 'link62')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> from the state.</p><p>To prevent issues with physics engine or user input, this adds the actor to a remove queue which is processed after all physics calculation and drawing operations of the current state.&nbsp; For immediate removal, see <a href="#gamvas.State.cleanUp" class=LFunction id=link63 onMouseOver="ShowTip(event, 'tt37', 'link63')" onMouseOut="HideTip('tt37')">cleanUp</a> .</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>act</td><td class=CDLDescription>a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link64 onMouseOver="ShowTip(event, 'tt30', 'link64')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> object or a string with the actor name</td></tr></table><h4 class=CHeading>See</h4><p><a href="#gamvas.State.cleanUp" class=LFunction id=link65 onMouseOver="ShowTip(event, 'tt37', 'link65')" onMouseOut="HideTip('tt37')">gamvas.State.cleanUp</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.registerInputEvents"></a>registerInputEvents</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>registerInputEvents: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Send keyboard/mouse events to <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link66 onMouseOver="ShowTip(event, 'tt30', 'link66')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> onKeyDown and similar functions</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>act</td><td class=CDLDescription>a <a href="gamvas-actor-js.html#gamvas.Actor" class=LClass id=link67 onMouseOver="ShowTip(event, 'tt30', 'link67')" onMouseOut="HideTip('tt30')">gamvas.Actor</a> object</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre>// default a actor state for the logic
myActorState = gamvas.ActorState.extend({
    onKeyDown: function(keyCode) {
        if (keyCode = gamvas.key.SPACE) {
            this.fireGun()
        }
    },
    fireGun: function() {
        console.log(this.actor.name + ' shoots');
    }
});

// define a actor
myActor = gamvas.Actor.extend({
    create: function(name, x, y) {
        this._super(name, x, y);
        this.addState(new myActorState('standard'));
        this.setState('standard');
    },
});

// now in our game state, create the actor and
// register it for receiving input events
myState = gamvas.State.extend({
    init: function() {
        this.player = new myActor('player');
        this.registerInputEvents(this.player);
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.addSound"></a>addSound</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addSound: function(</td><td class="PParameter  prettyprint " nowrap>snd</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Add a <a href="gamvas-sound-js.html#gamvas.Sound" class=LClass id=link68 onMouseOver="ShowTip(event, 'tt34', 'link68')" onMouseOut="HideTip('tt34')">gamvas.Sound</a> to the state.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>snd</td><td class=CDLDescription>either a url to the sound file, or a <a href="gamvas-sound-js.html#gamvas.Sound" class=LClass id=link69 onMouseOver="ShowTip(event, 'tt34', 'link69')" onMouseOut="HideTip('tt34')">gamvas.Sound</a> object</td></tr></table><h4 class=CHeading>Returns</h4><p>A <a href="gamvas-sound-js.html#gamvas.Sound" class=LClass id=link70 onMouseOver="ShowTip(event, 'tt34', 'link70')" onMouseOut="HideTip('tt34')">gamvas.Sound</a> object</p><h4 class=CHeading>Example</h4><blockquote><pre>myState = gamvas.State.extend({
    init: function() {
        this.shotSound = this.addSound(&quot;shotsound.wav&quot;);
    },
    myState.onKeyDown = function(keyCode, character) {
        if (keyCode == gamvas.key.SPACE) {
            this.shotSound.play();
        }
    }
});</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.getActors"></a>getActors</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getActors: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>returns all the actors added with <a href="#gamvas.State.addActor" class=LFunction id=link71 onMouseOver="ShowTip(event, 'tt29', 'link71')" onMouseOut="HideTip('tt29')">gamvas.State.addActor</a> as array, sorted by their <a href="gamvas-actor-js.html#gamvas.Actor.layer" class=LVariable id=link72 onMouseOver="ShowTip(event, 'tt36', 'link72')" onMouseOut="HideTip('tt36')">gamvas.Actor.layer</a></p><h4 class=CHeading>Note</h4><p>sorting is expensive, try to avoid this function by processing &lt;gamvas.State.actors&gt; directly or cache the result</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="gamvas.State.cleanUp"></a>cleanUp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">cleanUp: function()</td></tr></table></blockquote><h4 class=CHeading>Description</h4><p>Internal function that is called on the end of the state processing to remove all actors added to the remove queue via <a href="#gamvas.State.removeActor" class=LFunction id=link73 onMouseOver="ShowTip(event, 'tt31', 'link73')" onMouseOut="HideTip('tt31')">gamvas.State.removeActor</a>.</p><h4 class=CHeading>Note</h4><p>This function is called automatically.&nbsp; It prevents overlapping with physics and event processing.&nbsp; There is one special occasion where you may need to call this function manually, as reported by forum user Bart113: If you replace a actor, you would call <a href="#gamvas.State.removeActor" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt31', 'link74')" onMouseOut="HideTip('tt31')">gamvas.State.removeActor</a> followed by <a href="#gamvas.State.cleanUp" class=LFunction id=link75 onMouseOver="ShowTip(event, 'tt37', 'link75')" onMouseOut="HideTip('tt37')">gamvas.State.cleanUp</a> followed by <a href="#gamvas.State.addActor" class=LFunction id=link76 onMouseOver="ShowTip(event, 'tt29', 'link76')" onMouseOut="HideTip('tt29')">gamvas.State.addActor</a>.&nbsp; Only removing an actor without adding one with the same name may lead to a crash.</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="gamvas-base-js.html">gamvas</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-actor-js.html">gamvas.<wbr>Actor</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-actorstate-js.html">gamvas.<wbr>ActorState</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-animation-js.html">gamvas.<wbr>Animation</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astar-js.html">gamvas.<wbr>AStar</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargrid-js.html">gamvas.<wbr>AStarGrid</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astargridnode-js.html">gamvas.<wbr>AStarGridNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarmap-js.html">gamvas.<wbr>AStarMap</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-astarnode-js.html">gamvas.<wbr>AStarNode</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-camera-js.html">gamvas.<wbr>Camera</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-class-js.html">gamvas.<wbr>Class</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-config-js.html">gamvas.<wbr>config</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-dom-js.html">gamvas.dom</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-event-js.html">gamvas.<wbr>event</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-image-js.html">gamvas.<wbr>Image</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-key-js.html">gamvas.key</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-math-js.html">gamvas.math</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-mouse-js.html">gamvas.<wbr>mouse</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-particleemitter-js.html">gamvas.<wbr>ParticleEmitter</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-js.html">gamvas.<wbr>physics</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-physics-userdata-js.html">gamvas.<wbr>physics.<wbr>UserData</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-rect-js.html">gamvas.Rect</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-resource-js.html">gamvas.<wbr>Resource</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-screen-js.html">gamvas.<wbr>screen</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-sound-js.html">gamvas.<wbr>Sound</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-state-js.html">gamvas.<wbr>state</a></div></div><div class=MEntry><div class=MFile id=MSelected>gamvas.<wbr>State</div></div><div class=MEntry><div class=MFile><a href="gamvas-timer-js.html">gamvas.<wbr>timer</a></div></div><div class=MEntry><div class=MFile><a href="gamvas-vector2d-js.html">gamvas.<wbr>Vector2D</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Macros.html">Macros</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Functions">Functions</option><option value="Macros">Macros</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([], 2);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.disableCamera</td></tr></table></blockquote>By default a state provides a full environment for game development. </div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.name</td></tr></table></blockquote>The name of the state, must be unique within all states</div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.autoClear</td></tr></table></blockquote>If set to true, the screen will automatically cleared before drawing functions are called.</div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.clearColor</td></tr></table></blockquote>The color to clear the screen, if gamvas.State.autoClear is enabled. </div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.resource</td></tr></table></blockquote>a gamvas.Resource instance, to allow easy file loading</div></div><div class=CToolTip id="tt6"><div class=CClass>Class for resource handling, aka loading images and other game data</div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.canvas</td></tr></table></blockquote>The DOM element of the canvas the game is running on.</div></div><div class=CToolTip id="tt8"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.c</td></tr></table></blockquote>a HTML5 2D context of the canvas the game is running on. </div></div><div class=CToolTip id="tt9"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.dimension</td></tr></table></blockquote>a object holding the canvas dimension in {w, h}</div></div><div class=CToolTip id="tt10"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.camera</td></tr></table></blockquote>a gamvas.Camera instance, to modify camera.</div></div><div class=CToolTip id="tt11"><div class=CClass>The camera class.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">init: function()</td></tr></table></blockquote>The init function is called only once per state to initialize it.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">enter: function()</td></tr></table></blockquote>The enter function is called when the state is entered.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">leave: function()</td></tr></table></blockquote>The enter function is called when the state is left.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">clearScreen: function()</td></tr></table></blockquote>Clears the screen. </div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>preDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>This function is called before camera is applied. </div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>draw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Overwrite this function to draw your game objects. </div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>postDraw: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>This function is called after camera is applied. </div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>loading: function(</td><td class="PParameter  prettyprint " nowrap>t</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Overwrite for a custom loading screen</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyDown: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A key on the keyboard was pressed</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onKeyUp: function(</td><td class="PParameter  prettyprint " nowrap>keyCode,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>character,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A key on the keyboard was released</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseDown: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A mouse button was pressed</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseUp: function(</td><td class="PParameter  prettyprint " nowrap>button,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A mouse button was released</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onMouseMove: function(</td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>The mouse was moved</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchDown: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A finger starts touching the display</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchUp: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A finger stopped touching the display</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onTouchMove: function(</td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>x,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>y,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ev</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>A finger is sliding over the surface</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>onOrientation: function(</td><td class="PParameter  prettyprint " nowrap>alpha,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>beta,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>gamma</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>The device was tilted</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addActor: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a gamvas.Actor to the state. </div></div><div class=CToolTip id="tt30"><div class=CClass>The actor class is the most important class in gamvas. </div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>removeActor: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Removes a gamvas.Actor from the state.</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>registerInputEvents: function(</td><td class="PParameter  prettyprint " nowrap>act</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Send keyboard/mouse events to gamvas.Actor onKeyDown and similar functions</div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>addSound: function(</td><td class="PParameter  prettyprint " nowrap>snd</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a gamvas.Sound to the state.</div></div><div class=CToolTip id="tt34"><div class=CClass>A class for sound and music files.</div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">getActors: function()</td></tr></table></blockquote>returns all the actors added with gamvas.State.addActor as array, sorted by their gamvas.Actor.layer</div></div><div class=CToolTip id="tt36"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.layer</td></tr></table></blockquote>Integer value used for z-sorting on automatic draw through gamvas.State.addActor</div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">cleanUp: function()</td></tr></table></blockquote>Internal function that is called on the end of the state processing to remove all actors added to the remove queue via gamvas.State.removeActor.</div></div><div class=CToolTip id="tt38"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">gamvas.Resource.prototype.status = function()</td></tr></table></blockquote>Get the status of all loading resources</div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">exitEvent: function()</td></tr></table></blockquote>return from a unhandled keypress on onKey* functions</div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">exitEvent: function()</td></tr></table></blockquote>return from a unhandled mouseevent on onMouse* functions</div></div><div class=CToolTip id="tt41"><div class=CClass>Information and functions for the mouse.</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>